# -*- coding: utf-8 -*-

import sys
import os
CURRENT_PATH = os.path.join(os.path.dirname(__file__))
sys.path.extend([os.path.join(CURRENT_PATH, 'apps')])

CUSTOM_USER_MODEL = 'konto.userModel'

AUTHENTICATION_BACKENDS=(
    'konto.backends.UserBackend',
    'django.contrib.auth.backends.ModelBackend',
)

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ('Your Name', 'your_email@domain.com'),
)

MANAGERS = ADMINS

DATABASE_ENGINE = 'sqlite3'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'dev.sqlite'             # Or path to database file if using sqlite3.
DATABASE_USER = ''             # Not used with sqlite3.
DATABASE_PASSWORD = ''         # Not used with sqlite3.
DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'pl'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'pl'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = os.path.join(os.path.dirname(__file__), "site_media")

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/site_media/'

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'e*8c_xy#5)pp5s4mfh!)p(sfq$r&1)u^mshes-0t8w74tp-ylf'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
#     'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'konto.middleware.LoginMiddleware',
)

ROOT_URLCONF = 'mf-bridge.urls'

TEMPLATE_DIRS = (
    os.path.join(CURRENT_PATH, "tpl"),
)

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.core.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "django.core.context_processors.request",
    'session_messages.context_processors.session_messages',
    'blog.context_processors.blog',
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    
    'filebrowser',
    'sorl.thumbnail',
    'tinymce',
    'session_messages',
    
    'diamandas.myghtyboard',
    #'diamandas.pages',

    'konto',
    'projekty',
    'tools',
    'blog',
    'biblioteka',
    'kontakty',
    'wiki',
)

CONTACT_EMAIL = "bridge@mediaframe.pl"
SITE_NAME = "MediaFrame Bridge"

LOGIN_URL = 'http://127.0.0.1:8000/konto/zaloguj/'
LOGOUT_URL = '/konto/wyloguj/'
LOGIN_REDIRECT = '/'
LOGOUT_REDIRECT = '/'

LOGGING_OUTPUT_ENABLED = True
LOGGING_SHOW_METRICS = True
LOGGING_LOG_SQL = True

APPEND_SLASH = True
#PREPEND_WWW = True

#CACHE_BACKEND = "locmem:///?max_entries=3000"

FILE_UPLOAD_PERMISSIONS = 0644

SITE_DOMAIN = 'bridge.mediaframe.pl'
SITE_NAME = 'MF Bridge'
SITE_DESCRIPTION = 'MediaFrame Bridge - system najnowszej generacji :)'

# Dla myghtyboard (forum)
NOTIFY_ADMINS = False
